package com.example.edu_statistics.controller;


import com.example.commonutils.R;
import com.example.edu_statistics.client.UcenterClient;
import com.example.edu_statistics.service.StatisticsDailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-09-17
 */
@RestController
@RequestMapping("/edu_statistics/statistics_daily")
public class StatisticsDailyController {

    @Autowired
    private StatisticsDailyService service;

    @PostMapping("registerCount/{day}")
    public R registerCount(@PathVariable String day){

        service.registerCount(day);
        return R.ok();
    }

    @GetMapping("showData/{type}/{begin}/{end}")
    public R showData(@PathVariable String type,@PathVariable String begin,
                      @PathVariable String end) {
        Map<String,Object> map = service.getShowData(type,begin,end);
        return R.ok().data(map);
    }
}

